package com.cool.service.impl;

import com.cool.dao.ReserveMapper;
import com.cool.entity.Reserve;
import com.cool.service.ReserveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class ReserveServiceImpl implements ReserveService {
    @Autowired
    private ReserveMapper reserveMapper;
    public int insert(Reserve record){
        return reserveMapper.insert(record);
    }
    public int insertSelective(Reserve record){
        return reserveMapper.insertSelective(record);
    }
    public boolean isPayless(int uid){
            if(reserveMapper.isPayless(uid).size()==0){
                return false;
            }
            else return true;
    }
    public boolean isReserving(int uid){
        if(reserveMapper.isReserving(uid).size()==0){
            return false;
        }
        else return true;
    }
    public Reserve reserving(int uid){
        return reserveMapper.isReserving(uid).get(0);
    }
    public Reserve payless(int uid){
        return reserveMapper.isPayless(uid).get(0);
    }
}
